//
//  YJcinnectionCellView.m
//  SnackCourier
//
//  Created by qianfeng01 on 15/7/21.
//  Copyright (c) 2015年 qianfeng01. All rights reserved.
//

#import "YJcinnectionCellView.h"
#import "UIImageView+WebCache.h"

@interface YJcinnectionCellView ()
@property (nonatomic,weak) id target;
@property (nonatomic,assign) SEL action;

@end

@implementation YJcinnectionCellView

-(void)addtarget:(id)target action:(SEL)action{
    self.target =target;
    self.action =action;
}
//手指离开当前视图的时候
-(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event{
    //忽略SEL 产生的警告
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Warc-performSelector-leaks"
    
    if ([self.target respondsToSelector:self.action]) {
        [self.target performSelector:self.action withObject:self];
    }
#pragma clang diagnostic pop
}

-(void)showDataWithModel:(YJImmediatelygrabModel *)model{
    [self.imgUrlimageView sd_setImageWithURL:[NSURL URLWithString:model.imgUrl]];
    self.titleLabel.text = model.title;
    self.priceStr.text = [NSString stringWithFormat:@"￥:%@",model.priceStr];
    if (model.originalPriceStr.length) {
        self.originalPriceStrLabel.text =[NSString stringWithFormat:@"￥：%@",model.originalPriceStr];
    }
}

@end
